-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix parametrization reload #983
Conversation
…arametric testcases are captured.
.entries[new_case_index] | ||
.uid | ||
] | ||
tc = new_report[mt.uid][st.uid].entries[new_case_index] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider to introduce temporary variables instead of those long indexing chains. Speaking names could make this more(euphemism) readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved most of it to enumerate.
except KeyError: # new testcase | ||
pass | ||
mt.entries[st_index] = new_st | ||
if isinstance(case, TestGroupReport): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some test coverage for this change? To prevent future regression. Otherwise this looks great!
1b3e577
to
42d0026
Compare
# We reload and assert | ||
irunner.reload_report() | ||
|
||
for test in irunner.report: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pyifan In a nutshell, this test does the following:
- ensures that runtime status actually moves to ready upon change (this is functionally irrelevant tho)
- checks whether the original report state got restored (after alterations with new cases and parametrizations or removals of either) and whether everything at testcase level that was run and kept have been preserved under the reload
Seems smoother with public setters than mocking some behavior using proper mocks.
Bug / Requirement Description
Currently, the reload feature of the interactive UI does not capture changes to parametric testcases at parametrization level. In fact, changing any of the parameters will result in the old parameters possibly pointing to non-existent cases and the UI becomes hanging.
Solution description
Added parametrization level to the report reload so that changes to parametric testcases are captured.
Checklist: